package com.example.manager.controller;

import com.example.manager.domain.Order;
import com.example.manager.pojo.Result;
import com.example.manager.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/manager/orders")
public class OrderController {

    @Autowired
    private OrderService orderService;

    @GetMapping
    public Result<List<Order>> selectOrders() {
        return orderService.selectOrders();
    }

    @DeleteMapping("/{order_id}")
    public Result deleteOrder(@PathVariable Integer order_id) {
        return orderService.deleteOrder(order_id);
    }

}
